//DebugDrawLightsFX.h
//Created 14/10/13
//Created By Daniel Bowler
//
//Effect used to visualise our scene lights. In order to maintain some level
//of efficiency when a large number of lights is used (>1000), we make use
//of hardware instancing. 

#pragma once

#include "AbstractFX.h"

class DebugDrawLightsFX : public AbstractFX
{
	//ShaderManager creates this
	friend ShaderManager;
public:
	//Data structures - Note, we have two. One per vertex
	//and the other per instance.
	struct PerVertex
	{
		XMFLOAT3 PosL;
	};

	struct PerInstance
	{
		XMFLOAT4X4 WorldMatrix;
		XMFLOAT4 Colour;
	};

	//Set variables
	void SetViewProj(CXMMATRIX& vp);
	void SetEyePos(XMFLOAT3& eye);
private:
	//We dont want the user to directly create one of these (They work with
	//pointers), so hide the constructor/destructors. 
	DebugDrawLightsFX(ID3D11Device* device);
	~DebugDrawLightsFX();
	//Disable the copy constructor and the = operator
	DebugDrawLightsFX(const DebugDrawLightsFX& other);
	DebugDrawLightsFX& operator = (const DebugDrawLightsFX& other);

	//Override these to aid creating our shader.
	void InitInputLayout(ID3D11Device* device);
	void InitShaderVariablePointers();
private:
	//Effect variables.
	//View projection matrix.
	ID3DX11EffectMatrixVariable* viewProjVar;
	//Location of camera
	ID3DX11EffectVectorVariable* eyePosVar;
};